package cn.edu.scau.cmi.chenjia.client;

import java.util.Scanner;
import cn.edu.scau.cmi.chenjia.abstractFactory.*;

public class AbstractFactoryClient {
		public static void main(String args[]) {
			System.out.println("Please select brand:");
			Scanner in1=new Scanner(System.in);
			String input1=in1.nextLine();
			AbstractFactory abs=null;
			switch(input1) {
			case "Wens":
				abs=new WensFactory();
				break;
			case "Tianbang":
				abs=new WensFactory();
				break;
			case "Aonong":
				abs=new AonongFactory();
				break;
			default:
				System.out.println("Input error!");
				break;
			}
			if(abs!=null) {
			System.out.println("Please enter the production object:");
			Scanner in2=new Scanner(System.in);
			String input2=in2.nextLine();
			Meat meat=null;
			switch(input2) {
			case "pork":
				meat=abs.createPork();
				break;
			case "beef":
				meat=abs.createBeef();
				break;
			case "chicken":
				meat=abs.createChicken();
				break;
			default:
				System.out.println("Input error!");
				break;
			}
			if(meat!=null)
				meat.cook();
		}
			}
}
